<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style//css/reset.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style//css/transaction/add_form.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/patrol/project_device_alert.css">
</script>
<style scoped>
  .Flage{
      font-size: 20px;
      color:red;
      position: absolute;
      left: -13px;
      top: 4px;
  }
  .textFont{
      margin-left: 40px;
  }
</style>
<script type="text/html" id="titleTpl">
    <span class='table-edit'></span>
    <span  class='table-delete' ></span>
</script>
<div>
    <div class="layui-form " style="padding: 50px;" lay-filter="layuiadmin-form" id="layuiadmin-form">
        <div class="layui-table-box" style="padding: 50px;">
            <div class="layui-table-title">
                创建调拨工单信息
            </div>
            <ul class="layui-row ">
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="form layui-form-item">
                        <label class=" 
                    layui-label-inlineblock layui-form-label"><span style="font-size: 18px; color:red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>工单名称：</label>
                        <div class="layui-input-block">
                            <input type="text" name="tcReqName" autocomplete="off" class="layui-input"
                                lay-verify="required">
                        </div>
                    </div>

                    <div class="
                    form layui-form-item">
                        <label class=" 
                    layui-label-inlineblock    layui-form-label">OA申请编号：</label>
                        <div class="layui-input-block">
                        </div>

                    </div>
                    <div class="
                    form layui-form-item">
                        <label class=" 
                    layui-label-inlineblock    layui-form-label">申请日期：<span id="time"></span></label>
                        <div class="layui-input-block">
                        </div>

                    </div>
                </li>
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="
                    form layui-form-item">
                        <label>工单编号：</label>

                        <div class="layui-input-block" id="bianhao" style='display: flex;align-items: center;'>

                        </div>

                    </div>
                    <div class="form layui-form-item">
                        <label class=" layui-label-inlineblock   layui-form-label">调拨时间:</label>
                        <div class="layui-input-block" style='display: flex;align-items: center;'>

                            <input type="text" placeholder="请选择调拨时间" class="layui-input" id="test1" autocomplete="off"
                                >
                        </div>
                    </div>

                    <div class="form layui-form-item ">
                        <label class="layui-label-inlineblock layui-form-label"><i class="Flage">*</i>原所属公司：</label>
                        <div class="layui-input-block tcReqCoorig">
                            <select id="tcReqCoorig" name="tcReqCoorig" placeholder="请输入原所属公司" lay-search
                                lay-filter="company" lay-verify="required">
                            </select>
                        </div>
                    </div>
                </li>
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="form layui-form-item">
                        <label class=" layui-label-inlineblock   layui-form-label">工单状态：</label>
                        <div class="layui-input-block" style='display: flex;align-items: center;'>
                            未提交
                        </div>
                    </div>
                    <div class="
                    form layui-form-item">
                        <label class=" 
                    layui-label-inlineblock    layui-form-label">申请人：</label>
                        <div id="gen01" class="layui-input-block">

                        </div>


                    </div>
                    <div class="
                    form layui-form-item">
                        <label class="layui-label-inlineblock  layui-form-label"><i class="Flage">*</i>拟调往公司：</label>
                        <div class="layui-input-block tcReqCoalt">
                            <select id="tcReqCoalt" name="tcReqCoalt" placeholder="请输入拟调往公司" lay-search
                                lay-filter="company" lay-verify="required">
                            </select>
                        </div>
                    </div>
                </li>
                <li class="layui-col-md4 layui-col-sm4">


                </li>
            </ul>

            <div class="layui-table-box">

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">调拨说明:</label>
                    <div class="layui-input-block">
                        <textarea name="fil21" placeholder="请输入调拨说明" class="layui-textarea"
                           ></textarea>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">
                        备注：</label>
                    <div class="layui-input-block">
                        <textarea name="fil07" placeholder="请输入备注" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
        </div>

        <div class="title-btn layui-btn-containner">
            <button class="add layui-btn layui-btn-radius layui-btn-primary">
                <i class="add-icon layui-icon layui-icon-add-circle" style="font-size: 15px;"></i>
                <span class="btn-inner">添加设备</span>
            </button>
            <button class="modify layui-btn layui-btn-radius layui-btn-primary">
                <i class="layui-icon  layui-icon-edit"></i>
                <span class="btn-inner">批量修改</span>
            </button>
            <span class="textFont"><i style="color: red;">温馨提示</i>:保存状态调拨说明与备注可不填</span>
        </div>
        <div class="layui-card-body"></div>
        <table class="layui-table" lay-size="sm" id="baseTable" lay-filter="baseTable">
            <thead>
                <tr>
                 <th>序号</th>
                 <th>操作</th>
                 <th>设备编号</th>
                 <th>设备名称</th>
                 <th>设备类型</th>
                 <th>供应商</th>
                 <th>设备系列</th>
                 <th>设备型号</th>
                 <th>新资产编号</th>
                 <th>新负责部门</th>
                 <th>新负责人</th>
                 <th>新所在厂房</th>
                 <th>新站别线别</th>
                 <th>新所在楼层</th>
                 <th>新设备调机人员</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
        <div class="footer layui-btn-containner">
            <button class="commit layui-btn layui-btn-radius layui-btn-primary" lay-submit
                lay-filter="LAY-submit-tj">提交</button>
            <button class="hold layui-btn layui-btn-radius layui-btn-primary" lay-submit
                lay-filter="LAY-submit-bc">保存</button>
            <button class="cancel layui-btn layui-btn-radius layui-btn-primary" lay-filter="LAY-submit-qx">取消</button>
        </div>
    </div>
</div>
<!-- 巡检设备选择 -->
<script type="text/html" id="addDeviceTpl">
    <div class="leon-style-alert">
        <div class="layui-alert-box">
            <div class="layui-alert-title">
                <span class="layui-title-inner">调拨设备选择</span>
                <span class="layui-title-screen">
                    <div class="screen-btn">
                        <form class="layui-form" >
                            <input type="search" name="keyWord" class="search-blank-inner searchInput"
                                placeholder="搜索" autocomplete="off"/>
                            <button type="button" lay-submit lay-filter="queryTableProjectHeader"
                                class="search-blank-icon"></button>
                        </form>
                    </div>
                </span>
            </div>
            <div class="layui-content">
                <div class="con1 toggle-btn">
                    <span class="screen">
                        <i class="query-icon  layui-icon"></i>
                        <span class="query-inner">查询条件</span>
                    </span>
                    <i class="icon layui-icon layui-icon-down"></i>
                </div>
                <div class="con2 toggle-content">
                    <form action="" class="layui-form">
                        <label for="">设备编号:</label>
                        <input type="text" name="fia01" />
                        <label for="">设备名称:</label>
                        <input type="text" name="fia02" />
                        <label for="">供应商:</label>
                        <input type="text" name="fia09" />
                        <button type="button" lay-submit lay-filter="queryTableDevice"
                            class="query layui-btn layui-btn-radius layui-btn-primary">
                            <span class="search-icon"></span>
                            <span class="btn-inner">查询</span>
                        </button>
                    </form>
                </div>
                <table class="layui-table" id="table-device-alert" lay-filter="table-device-alert"></table>
            </div>
            <div class="footer layui-btn-containner">
                <button class="btn1 layui-btn layui-btn-radius layui-btn-primary" lay-submit lay-filter="add">添加</button>
                <button class="btn2 layui-btn layui-btn-radius layui-btn-primary">取消</button>
            </div>
        </div>
    </div>
</script>

<script>
    var shuju = {
        list: []
    }
    var i = 0;

    layui.use(['form', 'table', 'api', 'utill', 'laydate', 'jquery'], function () { //此段代码必不可少
        var table = layui.table,
            setter = layui.setter,
            laytpl = layui.laytpl,
            api = layui.api,
            utill = layui.utill,
            form = layui.form,
            admin = layui.admin,
            view = layui.view,
            element = layui.element,
            form = layui.form,
            $ = layui.jquery,
            laydate = layui.laydate;

        form.render(null, 'layuiadmin-form');
        $('[data-jump="transaction/balance"]').addClass('layui-this').attr('color', '#FFF');
        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
            ,
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss' //可任意组合
        });

        form.on('submit(LAY-submit-bc)', function (data) {
            
            var field = data.field
            shuju.fil01 = $('#bianhao').html()
            shuju.fil12 = $('#test1').val()
            shuju.fil07 = field.fil07
            shuju.fil08 = $('#gen01').html().split('-')[1]
            shuju.fil10 = utill.timestampToTime(new Date())
            shuju.fil21 = field.fil21
            shuju.tcReqCoalt = field.tcReqCoalt
            shuju.tcReqCoorig = field.tcReqCoorig
            shuju.tcReqName = field.tcReqName
            if(shuju.tcReqCoalt == shuju.tcReqCoorig){
               layer.open({content:"原公司与拟调往公司不能相同"});
               return;
            }
            for (let index = 0; index < shuju.list.length; index++) {
                shuju.list[index].tcDetailFiaplant = field.tcReqCoalt
            }
        
                bc(JSON.stringify(shuju))
            

        })
        $('.layui-form').on('click', '.cancel', function () {
            location.hash = '/transaction/balance'
        })
        form.on('submit(LAY-submit-tj)', function (data) {
            var field = data.field
            shuju.fil01 = $('#bianhao').html()

            shuju.fil12 = $('#test1').val()
            shuju.fil07 = field.fil07
            shuju.fil08 = $('#gen01').html().split('-')[1]
            shuju.fil10 = utill.timestampToTime(new Date())
            shuju.fil21 = field.fil21
            shuju.tcReqCoalt = field.tcReqCoalt
            shuju.tcReqCoorig = field.tcReqCoorig
            shuju.tcReqName = field.tcReqName
            for (let index = 0; index < shuju.list.length; index++) {
                shuju.list[index].tcDetailFiaplant = field.tcReqCoalt
            }
            if (shuju.list.length > 0) {
                tj(JSON.stringify(shuju))
            } else {
                layer.msg('请选择设备')
            }


        })

        function tj(data1) {
            var index = layer.load(2);
            admin.req({
                url: api.host + api.FilFileDBUpdateFileMove2,
                type: "post",
                data: data1,
                dataType: 'json',
                contentType: 'application/json',
                success: function (res) {
                    if(res.code == 0){
                        layer.close(index);
                        layer.open({
                            content: res.message
                        })
                        setTimeout(function(){
                            location.hash = '/transaction/balance'
                        },1000)
                    }else{
                        layer.close(index);
                        layer.open({
                            content: res.message
                        })
                    }
                },
                
            });
        }

        function bc(data1) {
           // utill.loading.show();
            admin.req({
                url: api.host + api.FilFileDBUpdateFileMove1,
                type: "post",
                data: data1,
                dataType: 'json',
                contentType: 'application/json',
                done: function (res) {
                    //utill.loading.hide();
                    if (res.code == '0') {
                        layer.msg("已保存",{
                            time:1000,
                            end:function () {
                                location.hash = '/transaction/balance'
                            }
                        })
                    } else {
                        layer.msg("保存失败",{
                            time:1000,
                            end:function () {
                                location.hash = '/transaction/balance'
                            }
                        })
                    }
                }
            });
        }

        document.getElementById('time').innerHTML = utill.timestampToTime(new Date())
        function tcReq() {
            admin.req({
                url: api.host + api.AzpSelectAllAzp,
                type: "POST",
                done: function (res) {
                    var str = '<option value=""></option>'
                    for (let index = 0; index < res.data.length; index++) {

                        str = str +
                            `<option value="${res.data[index].azp01}">${res.data[index].azp02}</option>`
                    }
                    $('#tcReqCoalt').html(str)
                    $('#tcReqCoorig').html(str)
                    form.render();
                }
            });
        }
        tcReq()

        admin.req({
            url: api.host + api.FilFileDBInsertFilFileMove,

            done: function (res) {

                $('#bianhao').html(res.data.str);
                if (res.data.name.length > 0) {
                    $('#gen01').html(res.data.name[0].gen02 + "-" + res.data.name[0].gen01);
                }



            }
        });
        $('.title-btn').on('click', '.modify', function (e) {
            if (!$("#tcReqCoalt").val()) {
                layer.msg('请先选择拟调往公司');
                return
            }
            sessionStorage.setItem('tcReqCoalt', $("#tcReqCoalt").val())
            var arr = []
            $('.xuan').each(function () {
                if ($(this).is(':checked')) {
                    var index = $(this).parents('td').parents('tr').index()
                    arr.push(index)
                }
            })
            if (arr.length == 0) {
                layer.msg('请先选择一条数据');
                return
            }
            admin.popup({
                title: '批量修改设备信息',
                area: ['400px', '400px'],
                id: 'LAY-popup-content-tags',
                success: function (layero, index) {
                    view(this.id).render('transaction/branch-one/eait').done(function () {
                        form.render(null, 'layuiadmin-form');

                        //监听提交
                        form.on('submit(LAY-submit)', function (data) {
                            var field = data.field; //获取提交的字段

                            for (let index = 0; index < arr
                                .length; index++) {
                                shuju.list[arr[index]].tcDetailFia11 = field.tcDetailFia11.split("/")[1].replace(
                                    /\s+/g, "")
                                shuju.list[arr[index]].tcDetailFia14 = field.tcDetailFia14.split("/")[0].replace(
                                    /\s+/g, "")
                                shuju.list[arr[index]].tcDetailFia16 = field.tcDetailFia16.split("/")[0].replace(
                                    /\s+/g, "")
                                shuju.list[arr[index]].tcDetailFia15 = field.tcDetailFia15.split("/")[0].replace(
                                    /\s+/g, "")
                                shuju.list[arr[index]].tcDetailFia17 = field.tcDetailFia17.split("/")[0].replace(
                                    /\s+/g, "")

                            }


                            field.tcDetailFia11 = field.tcDetailFia11.split("/")[0]
                            field.tcDetailFia14 = field.tcDetailFia14.split("/")[1]
                            field.tcDetailFia16 = field.tcDetailFia16.split("/")[1]
                            field.tcDetailFia15 = field.tcDetailFia15.split("/")[1]
                            field.tcDetailFia17 = field.tcDetailFia17.split("/")[1]



                            for (let index = 0; index < arr
                                .length; index++) {


                                $('#baseTable').find('> tbody').find('tr')
                                    .eq(arr[index]).find('td').eq(9).html(
                                        field.tcDetailFia11)
                                $('#baseTable').find('> tbody').find('tr')
                                    .eq(arr[index]).find('td').eq(11).html(
                                        field.tcDetailFia14)
                                $('#baseTable').find('> tbody').find('tr')
                                    .eq(arr[index]).find('td').eq(12).html(
                                        field.tcDetailFia16 + '-' + field
                                            .tcDetailFia17)
                                $('#baseTable').find('> tbody').find('tr')
                                    .eq(arr[index]).find('td').eq(13).html(
                                        field.tcDetailFia15)
                            }
                            layer.close(index); //执行关闭 


                        });
                        //监听提交
                        $('.layui-form').on('click', '.cancel', function () {
                            layer.close(index); //执行关闭 
                        })
                    });
                }
            });




        })
        var table_data = table.cache['#table-device-alert'];
        $('#baseTable').on('click', '.table-delete', function () {
            var index = $(this).parents('div').parents('td').parents('tr').index()
            shuju.list.splice(index, 1);
            $('#baseTable').find('> tbody tr').eq(index).remove();
            table.reload('#table-device-alert', { data: [], url: '' });
            table.cache['#table-device-alert'] = undefined;
        });
        function select_dis() {
            var table_data = table.cache['#table-device-alert'];
            var data_one = $('#tcReqCoalt').next().find('input').val();
            var data_two = $('#tcReqCoorig').next().find('input').val();
            if (table_data != undefined) {
                $('#tcReqCoorig').attr('disabled', 'disabled')
                $('#tcReqCoalt').attr('disabled', 'disabled')
                form.render()
                layer.msg('请清空设备信息!')
            } else {
                $('#tcReqCoorig').removeAttr('disabled')
                $('#tcReqCoalt').removeAttr('disabled')
                form.render()
            }
        }

        $('#baseTable').on('click', '.table-edit', function () {
            if (!$("#tcReqCoalt").val()) {
                alert('请先选择拟调往公司')
                return
            }
            var trindex = $(this).parents('div').parents('td').parents('tr').index()
            i = trindex;
            sessionStorage.setItem('fia01', shuju.list[trindex].fia01)
            sessionStorage.setItem('tcReqCoalt', $("#tcReqCoalt").val())
            admin.popup({
                title: '编辑设备信息',
                area: ['800px', '660px'],
                id: 'LAY-popup-content-tags',
                success: function (layero, index) {
                    view(this.id).render('transaction/branch-one/form_one')
                        .done(function () {
                            //监听提交
                            form.on('submit(LAY-submit)', function (data) {
                                var field = data.field; //获取提交的字段
                                shuju.list[trindex].tcDetailFia01 = field.fia01
                                shuju.list[trindex].tcDetailFia02 = field.fia02
                                shuju.list[trindex].tcDetailFia11 = field
                                    .tcDetailFia11.split("/")[1].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia10 = field
                                    .tcDetailFia10.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia14 = field
                                    .tcDetailFia14.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia16 = field
                                    .tcDetailFia16.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia15 = field
                                    .tcDetailFia15.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia17 = field
                                    .tcDetailFia17.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.list[trindex].tcDetailFia011 = field
                                    .tcDetailFia011.replace(/\s+/g, "")
                                shuju.list[trindex].tcDetailFiauser = field
                                    .tcDetailFiauser.split("/")[0].replace(
                                        /\s+/g, "")
                                field.tcDetailFia11 = field
                                    .tcDetailFia11.split("/")[0]
                                field.tcDetailFia10 = field
                                    .tcDetailFia10.split("/")[1]
                                field.tcDetailFia14 = field
                                    .tcDetailFia14.split("/")[1]
                                field.tcDetailFia16 = field
                                    .tcDetailFia16.split("/")[1]
                                field.tcDetailFia15 = field
                                    .tcDetailFia15.split("/")[1]
                                field.tcDetailFia17 = field
                                    .tcDetailFia17.split("/")[1]

                                field.tcDetailFiauser = field.tcDetailFiauser
                                    .split("/")[1]
                                var str = `
                                <td>
                                    <input type="checkbox" class='xuan'"></td>

                                 <td >
                                   <div style='display:flex' > <span class="table-edit"></span>
                                   <span  class="table-delete" ></span></div>
                                   </td>
                                 <td>${field.fia01}</td>
                                 <td>${field.fia02}</td>
                                 <td>${field.fic02}</td>
                                 <td>${field.pmc081}</td>
                                 <td>${field.tcSeriesName}</td>
                                 <td>${field.fii02}</td>
                                 <td>${field.tcDetailFia011}</td>
                                 <td>${field.tcDetailFia11}</td>
                                 <td>${field.tcDetailFia10}</td>
                                 <td>${field.tcDetailFia14}</td>
                                 <td>${field.tcDetailFia16}+${field.tcDetailFia17}</td>
                                 <td>${field.tcDetailFia15}</td>
                                 <td>${field.tcDetailFiauser}</td>
                                 `

                                $('#baseTable').find('> tbody').find('tr').eq(trindex).html(str)
                                layer.close(index); //执行关闭 
                                form.render()
                            });
                            $('.layui-form').on('click', '.cancel', function () {
                                layer.close(index); //执行关闭 
                            })
                        });
                }
            });

        });
        
            $('.title-btn').on('click', '.add', function (e) {
                if ($("#tcReqCoorig").val() == '' && $("#tcReqCoalt").val() == '') {
                    layer.msg("请选择原公司与新公司！")
                    return 
                } else if ($("#tcReqCoorig").val() == '' && $("#tcReqCoalt").val() == '') {
                    layer.msg("请先选择原所属公司拟调往公司！")
                    return
                } else if ($("#tcReqCoorig").val() == '') {
                    layer.msg("请选择原所属公司！")
                    return
                } else if ($("#tcReqCoalt").val() == '') {
                    layer.msg("请选择拟调往公司！")
                    return
                } else if ($("#tcReqCoorig").val() == $("#tcReqCoalt").val()) {
                    layer.msg("原所属公司与拟调往公司不能相同！")
                    return
                } else if ($("#tcReqCoorig").val() != $("#tcReqCoalt").val()) {
                    $('#tcReqCoorig').attr('disabled','disabled');
                    $('#tcReqCoalt').attr('disabled','disabled');
                    layer.open({
                        type: 1,
                        title: false,
                        area: ['662px', '536px'],
                        fixed: true,
                        shadeClose: true,
                        closeBtn: 0,
                        content: $('#addDeviceTpl').html(),
                        success: alertEvent.addDevice
                    });
                }
            })
       
        var alertEvent = {
            addDevice: function (layero, index) {
                table.render({
                    elem: '#table-device-alert',
                    id: "#table-device-alert",
                    height: 300,
                    loading: true,
                    method: 'POST',
                    toolbar: '',
                    cols: [
                        [{
                            type: 'checkbox',
                            width: 20
                        },
                        {
                            field: 'fia01',
                            title: '设备编号'
                        },
                        {
                            field: 'fia02',
                            title: '设备名称'
                        },
                        {
                            field: 'fia03',
                            title: '设备类型'
                        },
                        {
                            field: 'pmc081',
                            title: '供应商'
                        },
                        {
                            field: 'tcSeriesName',
                            title: '设备系列'
                        },
                        {
                            field: 'fii02',
                            title: '设备型号'
                        }
                        ]
                    ],

                    url: api.host + api.FilFileDBSelectFiaFiles,
                    request: {
                        pageName: 'pageNum',
                        limitName: 'pageSize',
                    },
                    headers: {
                        'token': layui.sessionData(setter.tableName).token
                    },
                    page: {
                        layout: ['prev', 'page', 'next', 'skip'],
                        limits: [10, 20, 30, 50],
                        theme: '#1E9FFF'
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "count": res.data.total, //解析数据长度
                            "data": res.data.list //解析数据列表
                        };
                    },
                    contentType: 'application/json',
                    where: {
                        tcReqCoorig: $('#tcReqCoorig').val(),
                        fia01: "",
                        fia02: "",
                        fia09: "",
                        keyWord: "",
                    }
                });
                utill.keyup('.search-blank-inner', '.search-blank-icon');
                form.on('submit(queryTableProjectHeader)', function (data) {
                    var allData = data.field;
                    table.reload('#table-device-alert', {
                        where: allData,
                    });
                    return false;
                })
                form.on('submit(queryTableDevice)', function (data) {
                    var allData = data.field;
                    table.reload('#table-device-alert', {
                        where: allData,
                    });
                    return false;
                })
                form.on('submit(queryTableDeviceHeader)', function (data) {
                    var allData = data.field;
                    table.reload('#table-device-alert', {
                        where: allData,
                    });
                    return false;
                })
                form.on('submit(add)', function (data) {
                        var checkedArr = table.checkStatus('#table-device-alert').data;
                        checkedArr.forEach(function (item, index) {
                            for (let index = 0; index < shuju.list.length; index++) {
                                if (shuju.list[index].fia01 == item.fia01) {
                                    layer.msg('请勿重复添加设备')
                                    return
                                }
                            }
                            item.tcDetailFil01 = $('#bianhao').html()
                            var TPL = `<tr>
                                <td><input type="checkbox" class='xuan'"></td>
                                    
                                      <td >
                                        <div style='display:flex' > <span class="table-edit"  ></span>
                                        <span  class="table-delete" ></span></div>
                                       
                                        </td>
                                      <td>${item.fia01}</td>
                                      <td>${item.fia02}</td>
                                      <td>${item.fia03}</td>
                                      <td>${item.pmc081}</td>
                                      <td>${item.tcSeriesName}</td>
                                      <td>${item.fii02}</td>
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      <td></td>

                                    </tr>`;
                            $('#baseTable').find('> tbody').append(TPL);
                            shuju.list.push(item)
                        })
                        form.render();
                        layer.closeAll()
                    return false;
                })
                $('.footer').on('click','.btn2',function(){
                    layer.closeAll()
                })
            }
        }

        // 下拉查询列表
        $('body').off('click', '.toggle-btn').on('click', '.toggle-btn', function () {
            if ($('.toggle-content').hasClass('toggle-content-on')) {
                $('.toggle-content').removeClass('toggle-content-on');
                $(this).find('.layui-icon-up').addClass('layui-icon-down').removeClass('layui-icon-up')
            } else {
                $('.toggle-content').addClass('toggle-content-on');
                $(this).find('.layui-icon-down').addClass('layui-icon-up').removeClass(
                    'layui-icon-down')
            }
        })
    });
</script>
<style>
    .layui-layer-btn a {
    height: 28px;
    line-height: 28px;
    margin: 5px 85px 0;
    padding: 0 15px;
    border: 1px solid #dedede;
    background-color: #fff;
    color: #333;
    border-radius: 2px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
}
</style>